ProcessHrtime.diff   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
1
import { NS_PER_MS } from 'myrmidon';
2
import Timer from './Timer';
3
4
export default class ProcessHrtime extends Timer {
5
    bench() {
6
        return process.hrtime.bigint();
7
    }
8
9
    diff(start, end) {
10
        const nsDiff = end - start;
11
        const msTime = nsDiff  / BigInt(NS_PER_MS);
12
13
        return Number(msTime);
14
    }
15
}
16